package com.karina.visualization.chart.client;

/**
 * 
 * Graphic interface defined the method which should be implemented by canvas
 * impl. there are so many method defined so far, need to clean up later.
 * 
 * @author kenny li(kenny.zlee@gmail.com)
 * 
 */
public interface Graphics {

	public static Color COLOR_ORANGE = new Color(255, 191, 0, 1.0);
	public static Color COLOR_RED = new Color(193, 0, 66, 1.0);
	public static Color COLOR_INDIANRED = new Color(205, 92, 92, 1.0);
	public static Color COLOR_LIME = new Color(0, 255, 0, 1.0);
	public static Color COLOR_AQUA = new Color(0, 255, 255, 1.0);
	public static Color COLOR_BROWN = new Color(255, 215, 96, 1.0);
	public static Color COLOR_DEEP_BLUE = new Color(74, 73, 255, 1.0);
	public static Color COLOR_GREEN = new Color(42, 255, 49, 1.0);

	public static Gradient BLUE_GLOSS_DEFAULT = new Gradient("#1E5799, 0.0",
			"#2989D8, 0.5", "#207cca, 0.5", "#7db9e8, 1.0");

	public static Gradient BLUE_3D_16 = new Gradient("#87e0fd, 0.0",
			"#53cbf1, 0.4", "#05abe0, 0.5");

	public static Gradient GREEN_3D_2 = new Gradient("#cdeb8e, 0.0",
			"#a5c956, 1.0");

	public static Gradient GREY_3D_1 = new Gradient("#cedce7, 0.0",
			"#596a72, 1.0");

	public static Gradient BRWO_3D_1 = new Gradient("#d5cea6, 0.0",
			"#c9c190, 0.4", "#b7ad70, 1.0");

	public static Gradient GREY_3D_2 = new Gradient("#606c88, 0.0",
			"#3f4c6b, 1.0");

	public static Gradient OLIVER_3D_1 = new Gradient("#fefefd, 0.0",
			"#dce3c4, 0.4", "#aebf76, 1.0");

	public static Gradient PINK_3D_1 = new Gradient("#cb60b3, 0.0",
			"#ad1283, 0.5", "#de47ac, 1.0");

	public static Gradient BLACK_3D_1 = new Gradient("#959595, 0.0",
			"#0d0d0d, 0.46", "#010101, 0.5", "#0a0a0a, 0.53", "#4e4e4e, 0.76",
			"#383838, 0.87", "#1b1b1b, 1.0");

	public static Color[] PRE_DEFINED_COLOR_ARRAY = new Color[] {
			Graphics.COLOR_ORANGE, Graphics.COLOR_GREEN,
			Graphics.COLOR_DEEP_BLUE, Graphics.COLOR_AQUA,
			Graphics.COLOR_BROWN, Graphics.COLOR_RED, Graphics.COLOR_INDIANRED,
			Graphics.COLOR_LIME };

	public static Gradient[] PRE_DEFINED_GRADIENT_ARRAY = new Gradient[] {
			BLUE_GLOSS_DEFAULT, BRWO_3D_1, PINK_3D_1, GREEN_3D_2, OLIVER_3D_1,
			BLUE_3D_16, GREY_3D_2, BLACK_3D_1 };

	public Graphics beginPath();

	public Graphics clear();

	public Graphics endPath();

	public Graphics arc(double x, double y, double radius, double startAngle,
			double endAngle, boolean antiClockwise);

	public Graphics fill();

	public int getCoordHeight();

	public int getCoordWidth();

	public double getGlobalAlpha();

	public Graphics lineTo(double x, double y);

	public Graphics moveTo(double x, double y);

	public Graphics rect(double startX, double startY, double width,
			double height);

	public Graphics restoreContext();

	public Graphics saveContext();

	public Graphics setCoordHeight(int height);

	public Graphics setCoordWidth(int width);

	public Graphics setGlobalAlpha(double alpha);

	public Graphics setLineWidth(double width);

	public Graphics stroke();

	public Graphics translate(double x, double y);

	Graphics drawText(double x, double y, String text, String alignType,
			String baseLine);

	Graphics setJointCap(String type);

	Graphics fillStyle(double x0, double y0, double x1, double y1,
			Gradient grapident);

	Graphics fillStyle(int red, int green, int blue, double alpha);

	Graphics fillRect(int x, int y, int width, int height);

	Graphics shallow(int xoffset, int yoffset, int shaddowblur, int red,
			int green, int blue, double alpha);

	Graphics setCompositeType(String type);

	Graphics drawCircle(double x, double y, int radius);

	void setLineColor(int r, int g, int b, double alpha);

	Graphics strokeWidth(int lineWidth);

	Graphics drawQuadraticChart(double cx, double cy, double x, double y,
			double xt, double yt);

	Graphics drawBezierChart(double x, double y, double cx1, double cy1,
			double cx2, double cy2, double tx, double ty);

	Graphics drawBezierChartTo(double cx1, double cy1, double cx2, double cy2,
			double tx, double ty);

}
